import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Login {

	public static void main(String[] args) {

		final String validUser = "davidodowd";
		final String validPassword = "PASS123";

		final String user = null;
		final String password = null;

		JFrame loginFrame = new JFrame("Login");
		loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		loginFrame.setSize(400, 200);

		JPanel p1 = new JPanel();
		loginFrame.add(p1);

		final JLabel l1 = new JLabel();
		l1.setText("Username");
		loginFrame.add(l1);

		final JTextField t1 = new JTextField();
		t1.setPreferredSize(new Dimension(100, 20));
		loginFrame.add(t1);

		final JLabel l2 = new JLabel();
		l1.setText("Password");
		loginFrame.add(l2);

		final JTextField t2 = new JTextField(10);
		t2.setPreferredSize(new Dimension(100, 20));
		loginFrame.add(t2);

		JButton b1 = new JButton("Login");
		p1.add(b1);
		b1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				user = t1.getText();
				password = t2.getText();

				if (user == validUser && password == validPassword) {
					// switch to dashboard
				} else {
					// output popup saying invalid username or password
				}
			}

		});

		loginFrame.show();

	}

}
